import { createStore, applyMiddleware } from 'redux'
import rootReducer from './reducers'
import trunk from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension'
import { getToken } from '../utils/storage'
//三个参数 第一个reducer  第二个默认store里的对象,可以省略 第三个中间件
const store = createStore(rootReducer, { login: getToken() }, composeWithDevTools(applyMiddleware(trunk)))

export default store;